<?xml version="1.0" encoding="UTF-8" ?>
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib prefix="form" uri="http://www.springframework.org/tags/form" %>
<%@ taglib prefix="spring" uri="http://www.springframework.org/tags"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
</head>
<body>

	<h3>${questionario.descricao}</h3>

	<spring:url var="url" value="/avaliacao/salvar" />
	<form action="${url}" method="post">
		<table>
			<tr>
				<td>
					<ul>		
						<c:forEach var="pergunta" items="${questionario.perguntas}">
							<li>${pergunta.descricao}</li>
							<ul>			
								<c:forEach var="resposta" items="${pergunta.respostas}">
									<li>
										<input type="radio" name="${pergunta.id}" value="${resposta.id}" />${resposta.ordem} - ${resposta.descricao}
									</li>		
								</c:forEach>
							</ul>
						</c:forEach>
					</ul>
				</td>
			</tr>
			<tr>
				<td colspan="2" align="right">
					<input type="button" value="Voltar" onclick="window.location = '<spring:url value="/questionarios" />';" />
					<input type="submit" value="Salvar" />
				</td>
			</tr>
		</table>
	</form>
	
</body>
</html>